package myJs.api

import japgolly.scalajs.react.extra.Ajax
import myJs.myPkg.MyFetch
import org.scalajs.macrotaskexecutor.MacrotaskExecutor.Implicits._
import upickle.default._

/** Created by yz on 12/9/2023
  */
object Anno {

  val baseUrl = s"${Api.apiUrl}/anno"

  def all = {
    val url = s"${baseUrl}/all"
    Ajax("GET", s"${url}").setRequestContentTypeJson.send.asAsyncCallback
      .map { xhr =>
        read[List[ujson.Obj]](xhr.responseText)
      }
  }

}
